<div id="block-lists" class="block">
  <div class="secondary-navigation">
    <ul>
      <% Category.all.each_with_index do |c, i|  %>
        <li class="<%= 0==i ? 'first' : ''  %> <%=  c.name == params[:keywords] ? 'active' : '' %>  "><a href="/news?keywords=<%= c.name   %>"><%= c.name %></a></li>
      <% end %>
<!--
      
      < % Basetable.find_by_name('文章热门关键字').content.split(" ").each do |c, i|  %>
        <li class="< %= 0==i ? 'first' : ''  %> < %=  c == params[:keywords] ? 'active' : '' %>  ">
        <a href="/news?keywords=< %= c   %>">< %= c %></a>
        </li>
       < % end %>
-->
    </ul>
    <div class="clear">   </div>
  </div>            
  
  <div class="content">
    <h1>行业快讯</h1>
    <%=render :partial =>"search" %>
     <table class="table" >
      <tr>
        <th><%= order_by_link({:category => :name} ,:text =>'分类' ) %></th>
        <th><%= order_by_link(:title ,:text =>'标题' ) %></th>
        <th>作者</th>
        <th>回复<%= order_by_link({:category => :total} ,:text =>'分类' ) %></th>
      </tr>
      
      <% @articles.each do |article| %>
        <tr>
          <td><%=h article.category.try(:name) %></td>
          <td><%=  link_to(h(article.title) , question_path(article)  ) %></td>
          <td><%=h article.user.try(:name) %></td>
          <td><%=h article.article_comments.count%></td>
        </tr>
      <% end %>
    </table>
    
    <br />
  </div>
</div>